<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>编辑栏目</title>
	<hdjs />
	<js file="__PUBLIC__/Js/mod.category.js" />
	<css file="__PUBLIC__/Css/mod.base.css" />
</head>
<body>
	<form action="" method="post" enctype='multipart/form-data' class='hd-form'>

		<div class="hd-menu-list">
			<ul>
				<li>
					<a href="{:U('Category/index')}" >栏目列表</a>
				</li>
				<li class="active">
					<a href="javascript:;" >编辑栏目</a>
				</li>
				<li>
					<a href="{:U('Category/update_cache')}">更新栏目缓存</a>
				</li>
			</ul>
		</div>
		<div class="hd-tab">
			<ul class="hd-tab-menu">
				<li lab='base' class="active">
					<a href="#">基本配置</a>
				</li>
				<li lab='view'>
					<a href="#">模板配置</a>
				</li>
			</ul>
			<div class="hd-tab-content">
				<div lab="base" clas='hd-tab-area'>
					<table class='hd-table hd-table-form hd-form'>
						<tbody>
							<tr>
								<th>模型</th>
								<td>{$field.model}</td>
							</tr>
							<tr>
								<th class="hd-w100">上级分类</th>
								<td>
									<if condition= 'isset($parent["cname"])'>
										{$parent.cname}
										<else />
										顶级栏目
									</if>
								</td>
							</tr>
							<tr>
								<th>文档类型</th>
								<td>

									<select name="type_typeid">
										<option value="0">请选择文档类型</option>
										<foreach name="type" item='v'>
											<option  value="{$v.typeid}" <if condition='$field["type_typeid"] eq $v["typeid"]'>selected='selected'</if>
											>{$v.typename}
										</option>
									</foreach>
								</select>

							</td>
						</tr>
						<tr>
							<th class="w100">分类名称</th>
							<td>
								<input value='{$field.cname}' type="text" name="cname"  class='hd-w200'/>
							</td>
						</tr>

						<tr >
							<th>栏目图片</th>
							<td>
								<input type="file" name='pic'/>
								<br/>
								<img src="{$field.pic}" alt=""  width="100" />
								<if condition='$field["has_pic"]'>
									<a href="javascript:;" onclick = "del_attachment(this,'{$field.cid}','pic')">删除</a>
								</if>
							</td>
						</tr>
						<tr>
							<th>分类关键字</th>
							<td>
								<textarea name="keywords" class='w500 h100'>{$field.keywords}</textarea>
							</td>
						</tr>

						<tr>
							<th>分类描述</th>
							<td>
								<textarea name="description" class='w500 h100'>{$field.description}</textarea>
							</td>
						</tr>

						<tr>
							<th>分类排序</th>
							<td>
								<input name="sort" type="text" class='hd-w200' value="{$field.sort}" />
							</td>
						</tr>

					</tbody>
				</table>
			</div>
			<div lab="view" class="hd-tab-area">
				<table class='hd-table hd-table-form hd-form'>
					<tbody>

						<tr>
							<th class='hd-w100'>每页记录数</th>
							<td>
								<input name="page" type="text" class='hd-w200' value="{$field.page}" />
							</td>
						</tr>
						<tr>
							<th>栏目类型</th>
							<td>
								<label>
									<input <if condition="1 eq $field['cat_type']">checked="checked"</if>
								type="radio" name="cat_type" value="1"/>
								<span>普通</span>
							</label>
							<label>
								<input <if condition="2 eq $field['cat_type']">checked="checked"</if>
							type="radio" name="cat_type" value="2"/>
							<span>封面</span>
						</label>
						<label>
							<input <if condition="3 eq $field['cat_type']">checked="checked"</if>
						type="radio" name="cat_type" value="3"/>
						<span>跳转</span>
					</label>
					<label>
						<input <if condition="4 eq $field['cat_type']">checked="checked"</if>
					type="radio" name="cat_type" value="4"/>
					<span>单页</span>
				</label>
			</td>
		</tr>
		<tr>
			<th>跳转地址</th>
			<td>
				<input name="go_url" type="text" class='hd-w200' value="{$field.go_url}" />
			</td>
		</tr>
		<tr>
			<th>跳转到子栏目</th>
			<td>
				<label>
					<input <if condition="!$field['go_child']">checked="checked"</if>
				type="radio" name="go_child" value="0"/>
				<span>否</span>
			</label>
			<label>
				<input <if condition="$field['go_child']">checked="checked"</if>
			type="radio" name="go_child" value="1"/>
			<span>是</span>
		</label>
	</td>
</tr>

<tr>
	<th>打开方式</th>
	<td>
		<label>
			<input <if condition="$field['target'] eq 1">checked="checked"</if>
		type="radio" name="target" value="1"/>
		<span>当前窗口</span>
	</label>
	<label>
		<input <if condition="$field['target'] eq 2">checked="checked"</if>
	type="radio" name="target" value="2"/>
	<span>新窗口</span>
</label>
</td>
</tr>
<tr>
<th >封面模板</th>
<td>
<input  class='hd-w200' type="text" name='default_tpl' value="{$field.default_tpl}"/>
</td>
</tr>
<tr>
<th>列表模板</th>
<td>
<input  class='hd-w200' type="text" name='list_tpl' value="{$field.list_tpl}"/>
</td>
</tr>
<tr>
<th>详细模板</th>
<td>
<input  class='hd-w200' type="text" name='view_tpl' value="{$field.view_tpl}"/>
</td>
</tr>
<tr>
<th>控制器</th>
<td>
<input  class='hd-w200' type="text" name='remark' value="{$field.remark}"/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

<div class="hd-position-bottom">
<input type="submit" class='hd-btn-primary hd-btn' value="编辑" />
<input type="button" class=" hd-btn" onclick="location.href='{:U('Category/index')}'" value="返回"/>
<input type="hidden" name="cid" value="{$Think.get.cid}" />
</div>
</form>
</body>
</html>